{% extends 'student_management/base.html' %}

{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
    <h2>课程列表</h2>
    <a href="{% url 'course-create' %}" class="btn btn-primary">添加课程</a>
</div>

<table class="table table-striped">
    <thead>
        <tr>
            <th>课程代码</th>
            <th>课程名称</th>
            <th>授课教师</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        {% for course in courses %}
        <tr>
            <td>{{ course.code }}</td>
            <td>{{ course.name }}</td>
            <td>{{ course.teacher.name }}</td>
            <td>
                <a href="{% url 'manage-scores' course.pk %}" class="btn btn-sm btn-info">管理成绩</a>
                <a href="{% url 'rate-teacher' course.pk %}" class="btn btn-sm btn-primary">评价教师</a>
                <a href="{% url 'course-update' course.pk %}" class="btn btn-sm btn-warning">编辑</a>
                <a href="{% url 'course-delete' course.pk %}" class="btn btn-sm btn-danger">删除</a>
            </td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% endblock %} 